﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class LeftTree : AdminUserBase
{
    protected void Page_Load(object sender, EventArgs e)
    {
        LoadMenu();
    }

    protected void LoadMenu()
    {
        if (this.SchoolID > 0)//学校管理员
        {

            switch (AdminType)
            {
                case 1:
                    MenuContainer.InnerHtml = createMenu("SchoolManager");//绑定学校管理的功能菜单
                   
                    break;
                case 2:
                    MenuContainer.InnerHtml = createMenu("CourseCharger");//课程内务功能菜单
                    
                    break;
                case 4:
                    MenuContainer.InnerHtml = createMenu("WebSiteEditor");//网站编辑功能菜单
                     
                    break;
                case 3:
                    MenuContainer.InnerHtml = createMenu("StudentRecruitCharger");//招生负责人功能菜单
                     
                    break;
            }


        }
        else if (AdminType == 0)
        {
            MenuContainer.InnerHtml = createMenu("SystemManager");//绑定学校管理的功能菜单
             
        }

    }

    private String createMenu(string roleTypeString)
    {
        String menuString = System.IO.File.ReadAllText(Server.MapPath("~/XML/") + roleTypeString + ".xml", Encoding.UTF8);
        return menuString;
    }
}
